<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>联系购买 - {$config.setup.name}</title>
    <meta name="keywords" content="{$config.setup.seokeywords}" />
    <meta name="description" content="{$config.setup.seodescription}" />
    <hdsyspage name="联系购买自定义模版" />
    {include:link}
</head>

<body>

    {include:head}
    {include:bannabg}



    <div class="container">
        <div class="row">

            <!-- right -->
            <div class="col-xs-12 col-sm-8 col-md-9" style="float:right">
                <div class="list_box">
                    <h2 class="left_h">联系购买</h2>
                   




                        <div class="feedback">
                            <form id="hdsys_Form" name="hdsys_Form" class="form-horizontal" method="post" action="" onsubmit="return false;">
                                <div class="form-group"><label for="title" class="col-sm-3 control-label">产品标题：</label>
                                    <div class="col-sm-6"><input type="text" value="{$get.title}" name="title" class="form-control" id="title" placeholder="必填"></div>
                                </div>
                                <div class="form-group"><label for="name" class="col-sm-3 control-label">您的称呼：</label>
                                    <div class="col-sm-6"><input type="text" name="name" class="form-control" id="name" placeholder="必填"></div>
                                </div>
                                <div class="form-group"><label for="contact" class="col-sm-3 control-label">联系电话：</label>
                                    <div class="col-sm-6"><input type="text" name="contact" class="form-control" id="contact" placeholder="必填"></div>
                                </div>
                                <div class="form-group"><label for="type" class="col-sm-3 control-label">电子邮箱：</label>
                                    <div class="col-sm-6"><input type="email" name="email" class="form-control" id="type"></div>
                                </div>

                                <div class="form-group"><label for="text" class="col-sm-3 control-label">留言内容：</label>
                                    <div class="col-sm-6"><textarea name="text" class="form-control" rows="3">我想咨询该产品</textarea></div>
                                </div>

                                <div class="form-group" style="margin-top:30px;">
                                    <div class="col-sm-offset-3 col-sm-10"><button type="submit" name="button" value="Send" class="hdsyscms_bin btn btn-danger page-btn">提交留言</button>&nbsp;
                                        <button type="reset" name="reset" class="btn btn-default grey-btn">重新填写</button>
                                    </div>
                                </div>
                            </form>
                        </div>





                </div>
            </div>

            <!-- left -->
            <div class="col-xs-12 col-sm-4 col-md-3">


                {navigation template='product' as="$vo"}

                {if $loop==1}

                <div class="left_nav" id="categories">
                    <h2 class="left_h">栏目导航</h2>
                    {/if}

                    <ul class="left_nav_ul" id="firstpane">
                        <li>
                            <a class="biglink" href="{@to($vo)}">{$vo.name}</a>
                        </li>
                    </ul>


                    {if $loop==1}
                </div>
                {/if}
                {/navigation}

                <div class="left_news">
                    <h2 class="left_h">推荐内容</h2>
                    {include:news}
                </div>
                {include:contact}
            </div>

        </div>
    </div>




    {include:bottom}



    <script>
        $(document).ready(function() {


            $(".hdsyscms_bin").click(function() {



                if (document.hdsys_Form.title.value.length == "") {
                    alert("留言标题不能为空！");
                    document.hdsys_Form.title.focus();
                    return false;
                }
                if (document.hdsys_Form.name.value.length == "") {
                    alert("请输入联系称呼");
                    document.hdsys_Form.name.focus();
                    return false;
                }
                if (document.hdsys_Form.contact.value.length == "") {
                    alert("电话不能为空！");
                    document.hdsys_Form.contact.focus();
                    return false;
                }


               
                var formData = $("#hdsys_Form").serialize(); 





                $.ajax({
                    type: "post",
                    url: 'index.php?m=front&c=index&a=contact',
                    data: formData,
                    dataType: "json",
                    success: function(ret) {
                        
                        if (ret.code == 1) {
                            alert('你的留言我们已收到,我们会尽快联系您！');
                            window.location.reload();
                        }else{
                            alert(ret.msg);
                        }


                    },
                    error: function(e, t) {
                        alert('接口请求返还异常');

                    }
                });


                return false;
            });


        });
    </script>
</body>

</html>